#ifndef CLIENT_H
#define CLIENT_H

#include <ncurses.h>
#include "../common/common.h"
#include "../common/protocol.h"
#include "../chess_logic/chess_logic.h"

// 客户端全局变量
extern int server_socket;
extern User current_user;
extern bool connected_to_server;

// 连接服务器
bool connect_to_server();

// 界面函数
void login_screen();
void register_screen();
void main_menu();
void offline_ai_game();
void online_players_screen();
void start_pvp_game(int opponent_id, char *opponent_name, int opponent_elo, bool is_white);

// 游戏相关
void game_loop(ChessGame *game, bool is_ai_game, int opponent_id);
void handle_player_input(ChessGame *game);

// 网络通信
void logout();
#endif
